package designpattern.factory;

public class OperationDiv extends Operation{

	public OperationDiv(Double num1, Double num2) {
		super(num1, num2);
		
	}

	@Override
	public Double operat() {
		if(this.getNum2()==0){
			System.out.println("0不能做除数");
			return 0d;
		}
		return this.getNum1()/this.getNum2();
	}

}
